package com.mingyuan.library.infra.common.event.publisher;

import com.mingyuan.library.domain.common.event.DomainEvent;
import com.mingyuan.library.domain.common.event.DomainEvents;
import lombok.AllArgsConstructor;
import org.springframework.context.ApplicationEventPublisher;

/**
 * 转发领域事件发布者
 */
@AllArgsConstructor
public class JustForwardDomainEventPublisher implements DomainEvents {

    /**
     * 应用事件发布者
     */
    private final ApplicationEventPublisher applicationEventPublisher;

    /**
     * 发布领域事件
     * @author yangzk
     * @param event 领域事件信息
     * @date 2024/1/5 14:22
     **/
    @Override
    public void publish(DomainEvent event) {
        applicationEventPublisher.publishEvent(event);
    }
}
